const express = require('express');
const router = express.Router();
const vocabularyController = require('../controllers/vocabularyController');
const { authenticate } = require('../middleware/auth');

// 所有路由都需要认证
router.use(authenticate);

router.get('/', vocabularyController.getVocabulary);
router.get('/learn', vocabularyController.getWordsToLearn);
router.get('/review', vocabularyController.getReviewWords);
router.get('/weak', vocabularyController.getWeakWords);
router.get('/statistics', vocabularyController.getStatistics);
router.get('/:wordId', vocabularyController.getWordDetail);
router.post('/answer', vocabularyController.recordAnswer);
router.post('/progress', vocabularyController.recordAnswer);

module.exports = router;

